package com.mate.cloud.redisson.datatype;

import org.redisson.api.*;

public class ListTest {
    public static void main(String[] args) throws InterruptedException {
        RedissonClient redissonClient = RedissonClientUtil.getClient();
        RDeque<String> msgList = redissonClient.getDeque("msgList");
        msgList.addFirst("周一:我和床才是原配，工作只是第三者");
        msgList.addFirst("周二:苍天啊！大地啊！时光时光快些吧！");
        msgList.addFirst("周三:就这样吧，我已悟透");
        msgList.addFirst("周四:明天周五了~");
        msgList.addFirst("周五:这周末我要先这样这样再那样那样，舒舒服服啊！");
        for (int i = 0; i <5 ; i++) {
            System.out.println(msgList.poll());
        }


//        RBlockingDeque<String> blockingDeque = redissonClient.getBlockingDeque("blockList");
//        while (true) {
//            System.out.println(blockingDeque.poll(1000, TimeUnit.SECONDS));
//        }

    }

}
